package cn.itcast.bos.service.area.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.AreaRepository;
import cn.itcast.bos.domain.base.Area;
import cn.itcast.bos.service.area.AreaService;
@Service
@Transactional
public class AreaServiceImp implements AreaService{
	 @Autowired
	private AreaRepository areaRepository;

	@Override
	public void saveBath(List<Area> list) {
		// save() 方法可以保存多个对象组成的集合  也可以保存单个的对象
		areaRepository.save(list);
		
	}
	public Page findPageDate(Specification<Area> specification,
			Pageable pageable) {
		
		return areaRepository.findAll(specification, pageable);
			
	}
}
